// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView, IndexLayout } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: IndexLayout,
    meta: { title: '首页', requireAuth: false },
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: 'bmsIndex',
        component: () => import('@/views/bmsIndex/BmsIndex'),
        meta: { title: '首页', keepAlive: true, requireAuth: false }
      },
      {
        path: '/bmsSp',
        name: 'bmsSp',
        component: () => import('@/views/bmsSp/BmsSp'),
        meta: { title: 'SP 平台代理商', keepAlive: true, requireAuth: false }
      },
      {
        path: '/bmsAp',
        name: 'bmsAp',
        component: () => import('@/views/bmsAp/BmsAp'),
        meta: { title: 'AP 资源供应商', keepAlive: true, requireAuth: false }
      },
      {
        path: '/dataCenter',
        name: 'dataCenter',
        component: () => import('@/views/bms/DataCenter'),
        meta: { title: '数据中心', keepAlive: true, requireAuth: false }
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('@/views/bms/About'),
        meta: { title: '关于我们', keepAlive: true, requireAuth: false }
      },
      {
        path: '/helpCenter',
        name: 'helpCenter',
        component: () => import('@/views/bms/HelpCenter'),
        meta: { title: '帮助中心', keepAlive: true, requireAuth: false }
      }
    ]
  },
  {
    path: '/toApplyFor',
    name: 'ToApplyFor',
    component: () => import('@/views/toApplyFor/ToApplyFor'),
    meta: { title: '加盟申请', keepAlive: true, icon: bxAnaalyse, requireAuth: true }
  },
  {
    path: '*', redirect: '/', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      }
    ]
  },
  {
    path: '/test',
    component: BlankLayout,
    redirect: '/test/home',
    children: [
      {
        path: 'home',
        name: 'TestHome',
        component: () => import('@/views/Home')
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }

]
